package com.JobFind.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

import com.JobFind.DTO.ResumeDTO;


/**
 * Tbresume entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="tb_resume",catalog="jobfind")
@Proxy(lazy = false)
public class TbResume  implements java.io.Serializable {

	
	private static final long serialVersionUID = 1L;
	private Integer resumeId;
    private TbCompany tbCompany;
    private TbUser tbUser;
    private String headPhoto;
    private String jobPosition;
    private String learningExperience;
    private String projectExperience;
    private String honor;
    private String hobby;
    private Integer resumeStatus;
    private String resumeRemarks;


    // Constructors

    /** default constructor */
    public TbResume() {
    }

    
    /** full constructor */
    public TbResume(TbCompany tbCompany, TbUser tbUser, String headPhoto, String jobPosition, String learningExperience, String projectExperience, String honor, String hobby, Integer resumeStatus, String resumeRemarks) {
        this.tbCompany = tbCompany;
        this.tbUser = tbUser;
        this.headPhoto = headPhoto;
        this.jobPosition = jobPosition;
        this.learningExperience = learningExperience;
        this.projectExperience = projectExperience;
        this.honor = honor;
        this.hobby = hobby;
        this.resumeStatus = resumeStatus;
        this.resumeRemarks = resumeRemarks;
    }

   
    // Property accessors
    @Id @GeneratedValue
    
    @Column(name="ResumeId", unique=true, nullable=false)

    public Integer getResumeId() {
        return this.resumeId;
    }
    
    public void setResumeId(Integer resumeId) {
        this.resumeId = resumeId;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="CompanyId")

    public TbCompany getTbCompany() {
        return this.tbCompany;
    }
    
    public void setTbCompany(TbCompany tbCompany) {
        this.tbCompany = tbCompany;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="UserId")

    public TbUser getTbUser() {
        return this.tbUser;
    }
    
    public void setTbUser(TbUser tbUser) {
        this.tbUser = tbUser;
    }
    
    @Column(name="HeadPhoto", length=20)

    public String getHeadPhoto() {
        return this.headPhoto;
    }
    
    public void setHeadPhoto(String headPhoto) {
        this.headPhoto = headPhoto;
    }
    
    @Column(name="JobPosition", length=100)

    public String getJobPosition() {
        return this.jobPosition;
    }
    
    public void setJobPosition(String jobPosition) {
        this.jobPosition = jobPosition;
    }
    
    @Column(name="LearningExperience", length=65535)

    public String getLearningExperience() {
        return this.learningExperience;
    }
    
    public void setLearningExperience(String learningExperience) {
        this.learningExperience = learningExperience;
    }
    
    @Column(name="ProjectExperience", length=65535)

    public String getProjectExperience() {
        return this.projectExperience;
    }
    
    public void setProjectExperience(String projectExperience) {
        this.projectExperience = projectExperience;
    }
    
    @Column(name="Honor", length=65535)

    public String getHonor() {
        return this.honor;
    }
    
    public void setHonor(String honor) {
        this.honor = honor;
    }
    
    @Column(name="Hobby", length=65535)

    public String getHobby() {
        return this.hobby;
    }
    
    public void setHobby(String hobby) {
        this.hobby = hobby;
    }
    
    @Column(name="ResumeStatus")

    public Integer getResumeStatus() {
        return this.resumeStatus;
    }
    
    public void setResumeStatus(Integer resumeStatus) {
        this.resumeStatus = resumeStatus;
    }
    
    @Column(name="ResumeRemarks", length=65535)

    public String getResumeRemarks() {
        return this.resumeRemarks;
    }
    
    public void setResumeRemarks(String resumeRemarks) {
        this.resumeRemarks = resumeRemarks;
    }
    
    public ResumeDTO toDTO(){
    	ResumeDTO resumeDTO = new ResumeDTO();
    	resumeDTO.setHeadPhoto(this.getHeadPhoto());
    	resumeDTO.setHobby(this.getHobby());
    	resumeDTO.setHonor(this.getHonor());
    	resumeDTO.setJobPosition(this.getJobPosition());
    	resumeDTO.setLearningExperience(this.getLearningExperience());
    	resumeDTO.setProjectExperience(this.getProjectExperience());
    	resumeDTO.setResumeId(this.getResumeId());
    	resumeDTO.setResumeRemarks(this.getResumeRemarks());
    	resumeDTO.setResumeStatus(this.getResumeStatus());
    	resumeDTO.setUserDTO(this.getTbUser().toDTO());
    	resumeDTO.setCompanyDTO(this.getTbCompany().toDTO());
    	return resumeDTO;
    }

}